package cn.train.controler;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.train.model.Contable;
import cn.train.model.UserTable;
import cn.train.service.UserTableService;
@WebServlet("/GetContServlet")
public class GetContServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		
		UserTable user=(UserTable)req.getSession().getAttribute("usertable");
//		System.out.println(luid);
		int uid = user.getUid();
		
		UserTableService userService=new UserTableService();
		List<Contable> list=userService.getContable(uid);
		req.setAttribute("list", list);
		req.getRequestDispatcher("/font/vip_user.jsp").forward(req, resp);
	}
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req,resp);
	}

}
